Q: Why does my database crash with a type 1 in CB_FillLst()?
a) The external area may not exist. External areas exist only while the layout that contains them is active. For this reason, any ComboBox command that requires an external area as one of its parameters must be called from either the layout procedure, or from an object script. (These commands may be called from global procedures as long as the global procedure is originally called from the layout procedure or an object script).
b) The array may not be declared correctly. Arrays passed to CB_FillLst() must be declared prior to calling CB_FillLst(). Also, they must be declared as a single-dimensioned array of type text:
ARRAY TEXT(MyArray;5)
c) The array may be a local array. Arrays passed to CB_FillLst() must be declared as either process or interprocess arrays.
d) The array name may have been passed incorrectly. Arrays passed to CB_FillLst() must be passed as a string:
CB_FillLst (MyCombo;"MyArray")
or
CB_FillLst (MyCombo;"◊MyArray")
or
CB_FillLst (MyCombo;"<>MyArray")
Q: Why do I get garbage from CB_GetTxt()?
In 4D, a text variable is a handle to another portion of memory that actually holds the text. Until a value is assigned to the variable, the extra memory is not allocated. Consider the following code:
C_TEXT($vText)
CB_GetTxt (MyCombo;$vText)
At the point CB_GetTxt() is called, $vText has never had a value, so that extra memory remains unallocated. As far as I know, there's no way I can take care of that from an external.
To take care of the problem, simply set $vText:="" before you call CB_GetTxt():